<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Building / Compiling From Source</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mysql-xdevapi.configuration.html">« 运行时配置</a></li>
      <li style="float: right;"><a href="mysql-xdevapi.constants.html">预定义常量 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="mysql-xdevapi.setup.html">安装/配置</a></li>
    <li>Building / Compiling From Source</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mysql-xdevapi.build" class="section">
   <h2 class="title">Building / Compiling From Source</h2>
   <p class="para">
     Considerations for compiling this extension from source.
   </p>

    <ul class="itemizedlist">
      <li class="listitem">
        <p class="para">
          The extension name is &#039;mysql_xdevapi&#039;, so use <code class="literal">--enable-mysql-xdevapi</code>.
        </p>
      </li>
      <li class="listitem">
        <p class="para">
          Boost: required,  optionally use the --with-boost=DIR configure option
          or set the MYSQL_XDEVAPI_BOOST_ROOT environment variable. Only the
          boost header files are required; not the binaries.
        </p>
      </li>
      <li class="listitem">
        <p class="para">
          Google Protocol Buffers (protobuf): required,  optionally use the --with-protobuf=DIR
          configure option or set the MYSQL_XDEVAPI_PROTOBUF_ROOT environment variable.
        </p>
        <p class="para">
          Optionally use <code class="literal">make protobufs</code> to generate protobuf files (*.pb.cc/.h),
          and <code class="literal">make clean-protobufs</code> to delete generate protobuf files.
        </p>
        <p class="para">
          Windows specific protobuf note: depending on your environment,
          the static library with a multi-threaded DLL runtime may be needed.
          To prepare, use the following options:
          <em class="emphasis">-Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF</em>
        </p>
      </li>
      <li class="listitem">
        <p class="para">
          Google Protocol Buffers / protocol compiler (protoc): required, ensure that proper
          &#039;protoc&#039; is available in the PATH while building. It is especially
          important as Windows PHP SDK batch scripts may overwrite the environment.
        </p>
      </li>
        <li class="listitem">
          <p class="para">
            Bison: required, and available from the PATH.
          </p>
          <p class="para">
            Windows specific bison note: we strongly recommended that bison delivered with the
            chosen PHP SDKis used else an error similar to &quot;zend_globals_macros.h(39):
            error C2375: &#039;zendparse&#039;: redefinition; different linkage
            Zend/zend_language_parser.h(214): note: see declaration of &#039;zendparse&#039;&quot; may
            be the result. Also, Windows PHP SDK batch scripts may overwrite the environment.
          </p>
        </li>
      <li class="listitem">
        <p class="para">
          Windows Specific Notes: To prepare the environment, see the official
          Windows build documentation for 
          <a href="https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2" class="link external">&raquo;&nbsp;the current SDK</a>.
        </p>
        <p class="para">
          We recommend using the backslash &#039;\\&#039; instead of a slash &#039;/&#039; for all paths.
        </p>
      </li>
    </ul>
  </div></div></div></body></html>